package com.detrum.sportcamera.jlibrtp;

public class PktBufNode{
    /** The next node within the frame, i.e. higher sequence number, same RTP timestamp */
    protected PktBufNode nextPktNode = null;
    /** The next node within the frame, i.e. lower sequence number, same RTP timestamp */
    protected PktBufNode prevPktNode = null;

    protected RtpPkt pkt = null;
    protected long timeStamp;
    protected int PayloadType;
    protected int seqNum;
    /** The sequence number associated with this node */
    protected int len;
    protected boolean isMarked;

    /**
     * Create a new packet buffer node based on a packet
     * @param aPkt the packet
     */
    protected PktBufNode(RtpPkt aPkt) {
        pkt = aPkt;
        seqNum = aPkt.getSeqNumber();
        len = aPkt.getPayloadLength();
        timeStamp = aPkt.getTimeStamp();
        isMarked = aPkt.isMarked();
        PayloadType = aPkt.getPayloadType();
    }

    protected int getData(byte[] buf, int buf_offset, int pkt_offset, int len){
        return pkt.getPayload(buf,buf_offset,pkt_offset ,len);
    }

    protected byte getByte(int offset){
        return pkt.getByte(offset);
    }
}